home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / catD / getrbuf.z / getrbuf
Encoding:
Text File  |  2002-10-03  |  6.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ggggeeeettttrrrrbbbbuuuuffff((((DDDD3333))))                                                        ggggeeeettttrrrrbbbbuuuuffff((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff - get a raw buffer header
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_bbbb_uuuu_ffff_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_kkkk_mmmm_eeee_mmmm_...._hhhh_>>>>
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
  15.  
  16.      _bbbb_uuuu_ffff______tttt _****_gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff_((((_llll_oooo_nnnn_gggg _f_l_a_g_))))_;;;;
  17.  
  18.  
  19.    AAAArrrrgggguuuummmmeeeennnnttttssss
  20.      _f_l_a_g          Indicates whether the caller should sleep for free space.
  21.  
  22. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  23.      _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff allocates the space for a buffer header (see _bbbb_uuuu_ffff(D4)).  If _f_l_a_g
  24.      is set to _KKKK_MMMM______SSSS_LLLL_EEEE_EEEE_PPPP, the caller will sleep if necessary until memory is
  25.      available.  If _f_l_a_g is set to _KKKK_MMMM______NNNN_OOOO_SSSS_LLLL_EEEE_EEEE_PPPP, the caller will not sleep, but
  26.      _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff will return _NNNN_UUUU_LLLL_LLLL if memory is not immediately available.
  27.  
  28.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  29.      Upon successful completion, _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff returns a pointer to the allocated
  30.      buffer header.  If _KKKK_MMMM______NNNN_OOOO_SSSS_LLLL_EEEE_EEEE_PPPP is specified and sufficient memory is not
  31.      immediately available, _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff returns a _NNNN_UUUU_LLLL_LLLL pointer.
  32.  
  33. UUUUSSSSAAAAGGGGEEEE
  34.      _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff is used when a block driver is performing raw I/O (character
  35.      interface) and needs to set up a buffer header that is not associated
  36.      with a system-provided data buffer.  The driver provides its own memory
  37.      for the data buffer.
  38.  
  39.      After allocating the buffer header, the caller must set the _bbbb______iiii_oooo_dddd_oooo_nnnn_eeee
  40.      field to the address of an iodone handler to be invoked when the I/O is
  41.      complete (see _bbbb_iiii_oooo_dddd_oooo_nnnn_eeee(D3)).  The caller must also initialize the
  42.      following fields:
  43.  
  44.      _bbbb______ffff_llll_aaaa_gggg_ssss       Must be modified to indicate the direction of data
  45.                    transfer.  Initially, it is set to indicate the transfer is
  46.                    from the user's buffer to the kernel.  The driver must set
  47.                    the _BBBB______RRRR_EEEE_AAAA_DDDD flag if the transfer is from the kernel to the
  48.                    user's buffer.
  49.  
  50.      _bbbb______eeee_dddd_eeee_vvvv        Must be initialized to the proper device number.
  51.  
  52.      _bbbb______bbbb_cccc_oooo_uuuu_nnnn_tttt      Must be set to the number of bytes to transfer.
  53.  
  54.      _bbbb______uuuu_nnnn_...._bbbb______aaaa_dddd_dddd_rrrr   Must be set to the virtual address of the caller-supplied
  55.                    buffer.
  56.  
  57.      _bbbb______bbbb_llll_kkkk_nnnn_oooo       Must be set to the block number to be accessed.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggeeeettttrrrrbbbbuuuuffff((((DDDD3333))))                                                        ggggeeeettttrrrrbbbbuuuuffff((((DDDD3333))))
  71.  
  72.  
  73.  
  74.      _bbbb______rrrr_eeee_ssss_iiii_dddd       Must be set to the same value as _bbbb______bbbb_cccc_oooo_uuuu_nnnn_tttt.
  75.  
  76.      _bbbb______bbbb_uuuu_ffff_ssss_iiii_zzzz_eeee     Can be used to remember the size of the data buffer
  77.                    associated with the buffer header.
  78.  
  79.      Typically, block drivers do not allocate buffers.  The buffer is
  80.      allocated by the kernel and the associated buffer header is used as an
  81.      argument to the driver _ssss_tttt_rrrr_aaaa_tttt_eeee_gggg_yyyy routine.  However, to implement some
  82.      special features, such as _iiii_oooo_cccc_tttt_llll(D2) commands that perform I/O, the driver
  83.      may need its own buffer space.  The driver can get the buffer space from
  84.      the system by using _gggg_eeee_tttt_eeee_bbbb_llll_kkkk(D3) or _nnnn_gggg_eeee_tttt_eeee_bbbb_llll_kkkk(D3).  Or the driver can
  85.      choose to use its own memory for the buffer and only allocate a buffer
  86.      header with _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff.
  87.  
  88.    LLLLeeeevvvveeeellll
  89.      Base only if _f_l_a_g is set to _KKKK_MMMM______SSSS_LLLL_EEEE_EEEE_PPPP.
  90.  
  91.      Base or Interrupt if _f_l_a_g is set to _KKKK_MMMM______NNNN_OOOO_SSSS_LLLL_EEEE_EEEE_PPPP.
  92.  
  93.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  94.      May sleep if _f_l_a_g is set to _KKKK_MMMM______SSSS_LLLL_EEEE_EEEE_PPPP.
  95.  
  96.      Driver-defined basic locks and read/write locks may be held across calls
  97.      to this function if _f_l_a_g is _KKKK_MMMM______NNNN_OOOO_SSSS_LLLL_EEEE_EEEE_PPPP, but may not be held if _f_l_a_g is
  98.      _KKKK_MMMM______SSSS_LLLL_EEEE_EEEE_PPPP.
  99.  
  100.      Driver-defined sleep locks may be held across calls to this function
  101.      regardless of the value of _f_l_a_g.
  102.  
  103. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  104.      biodone(D3), biowait(D3), buf(D4), freerbuf(D3).
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.